#include "Player.h"
#include <iostream>

Player::Player(const CharacterPtr &character, const RoomPtr &room)
	: character(character), room(room)
{
}

Player::~Player()
{
}

void Player::initialize()
{
	character->setPlayer(shared_from_this());
	room->enter(character, Exit::NULL_EXIT);
}

void Player::handle(const CommandPtr &command, const std::vector<std::string> &args)
{
	if(character->canHandleCommand(command))
	{
		command->execute(character, room, args);
		return;
	}
	std::cout << "You don't know how to do that!" << std::endl;
}

void Player::update(unsigned int tick)
{
	room->update(tick);
}
